﻿using OpenAI.GPT3.Managers;
using OpenAI.GPT3.ObjectModels.RequestModels;
using OpenAI.GPT3.ObjectModels;
using OpenAI.GPT3;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DAL
{
    public class ChatGPT
    {
        //const string OPENAPI_TOKEN = "sk-************************";//输入自己的api-key
        //private async void Chat()
        //{
        //    OpenAIService service = new OpenAIService(new OpenAiOptions() { ApiKey = OPENAPI_TOKEN });
        //    CompletionCreateRequest createRequest = new CompletionCreateRequest()
        //    {

        //        Prompt = "写一首关于工作的诗",
        //        Temperature = 0.3f,
        //        MaxTokens = 1000
        //    };

        //    var res = await service.Completions.CreateCompletion(createRequest, Models.TextDavinciV3);

        //    if (res.Successful)
        //    {
        //        var ss = res.Choices.FirstOrDefault().Text;
        //        Console.WriteLine(ss);
        //    }

        //}

    }
}
